class Solution(object):
    def canJump(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        max_i = 0
        L = len(nums)
        for i in range(L):
            #当前位置是否可到达
            if i > max_i:
                return False
            #更新最远可到达的地方
            max_i = max(max_i, i + nums[i])
        return max_i >= L - 1
